from docx import Document

path = 'file.docx'

doc = Document(path)
# print(doc.paragraphs)

# for paragraph in doc.paragraphs:
# 	print('------------------------')
# 	print(paragraph.text)
# 	print('------------------------')

tables=doc.tables
print(len(tables))
num=0
for i in range(len(tables)):
    tb=tables[i]
    #获取表格的行
    tb_rows=tb.rows
    #读取每一行内容
    for i in range(len(tb_rows)):
        row_data=[]
        row_cells=tb_rows[i].cells
        #读取每一行单元格内容
        for cell in row_cells:
            #单元格内容
            row_data.append(cell.text)
        print(row_data)
